<template>
    <el-config-provider :locale="getGlobalI18n" :size="getGlobalComponentSize">
        <router-view />
        <Settings re="setingsRef" />
    </el-config-provider>
</template>
<script setup lang="ts" name="app">
import { computed, onBeforeMount, defineAsyncComponent } from 'vue'
import { useI18n } from 'vue-i18n'
import setIntroduction from '@/utils/setIconfont'
// import { globalComponentSize } from "@/utils/index";
const Settings = defineAsyncComponent(() => import('@/layout/components/nav-bars/top-bars/Settings.vue'))
// 引入组件
// 定义变量内容
const { messages, locale } = useI18n()

// 获取全局组件大小
const getGlobalComponentSize = computed(() => {
    // return globalComponentSize();
    return 'default'
})

// 获取全局 i18n
const getGlobalI18n = computed(() => {
    return messages.value[locale.value]
})

// 设置初始化，防止刷新时恢复默认
onBeforeMount(() => {
    // 批量设置第三方 css
    setIntroduction.cssCdn()
    // 批量设置第三方 js
    setIntroduction.jsCdn()
})
</script>
